Optimal. Leaf size=91 \[ -\frac{a^2 (A-3 i B)}{c^2 f (\tan (e+f x)+i)}+\frac{a^2 (B+i A)}{c^2 f (\tan (e+f x)+i)^2}-\frac{a^2 B \log (\cos (e+f x))}{c^2 f}-\frac{i a^2 B x}{c^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.151359, antiderivative size = 91, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ -\frac{a^2 (A-3 i B)}{c^2 f (\tan (e+f x)+i)}+\frac{a^2 (B+i A)}{c^2 f (\tan (e+f x)+i)^2}-\frac{a^2 B \log (\cos (e+f x))}{c^2 f}-\frac{i a^2 B x}{c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 77
Rubi steps
\begin{align*} \int \frac{(a+i a \tan (e+f x))^2 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^2} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(a+i a x) (A+B x)}{(c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (-\frac{2 i a (A-i B)}{c^3 (i+x)^3}+\frac{a (A-3 i B)}{c^3 (i+x)^2}+\frac{a B}{c^3 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{i a^2 B x}{c^2}-\frac{a^2 B \log (\cos (e+f x))}{c^2 f}+\frac{a^2 (i A+B)}{c^2 f (i+\tan (e+f x))^2}-\frac{a^2 (A-3 i B)}{c^2 f (i+\tan (e+f x))}\\ \end{align*}
Mathematica [B] time = 3.16926, size = 184, normalized size = 2.02 \[ \frac{a^2 (\cos (2 (e+2 f x))+i \sin (2 (e+2 f x))) \left (-i \cos (2 (e+f x)) \left (A-2 i B \log \left (\cos ^2(e+f x)\right )+8 B f x-i B\right )+A \sin (2 (e+f x))-8 B f x \sin (2 (e+f x))-i B \sin (2 (e+f x))+2 i B \sin (2 (e+f x)) \log \left (\cos ^2(e+f x)\right )+4 B \tan ^{-1}(\tan (3 e+f x)) (\sin (2 (e+f x))+i \cos (2 (e+f x)))+4 B\right )}{4 c^2 f (\cos (f x)+i \sin (f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.044, size = 116, normalized size = 1.3 \begin{align*}{\frac{3\,i{a}^{2}B}{f{c}^{2} \left ( \tan \left ( fx+e \right ) +i \right ) }}-{\frac{{a}^{2}A}{f{c}^{2} \left ( \tan \left ( fx+e \right ) +i \right ) }}+{\frac{iA{a}^{2}}{f{c}^{2} \left ( \tan \left ( fx+e \right ) +i \right ) ^{2}}}+{\frac{{a}^{2}B}{f{c}^{2} \left ( \tan \left ( fx+e \right ) +i \right ) ^{2}}}+{\frac{{a}^{2}B\ln \left ( \tan \left ( fx+e \right ) +i \right ) }{f{c}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.50054, size = 161, normalized size = 1.77 \begin{align*} \frac{{\left (-i \, A - B\right )} a^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, B a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, B a^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{4 \, c^{2} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.13304, size = 162, normalized size = 1.78 \begin{align*} - \frac{B a^{2} \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c^{2} f} + \begin{cases} \frac{4 B a^{2} c^{2} f e^{2 i e} e^{2 i f x} + \left (- i A a^{2} c^{2} f e^{4 i e} - B a^{2} c^{2} f e^{4 i e}\right ) e^{4 i f x}}{4 c^{4} f^{2}} & \text{for}\: 4 c^{4} f^{2} \neq 0 \\\frac{x \left (A a^{2} e^{4 i e} - i B a^{2} e^{4 i e} + 2 i B a^{2} e^{2 i e}\right )}{c^{2}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.53521, size = 275, normalized size = 3.02 \begin{align*} \frac{\frac{12 \, B a^{2} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}{c^{2}} - \frac{6 \, B a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{c^{2}} - \frac{6 \, B a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{c^{2}} - \frac{25 \, B a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 12 \, A a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 112 i \, B a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 198 \, B a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 12 \, A a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 112 i \, B a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 25 \, B a^{2}}{c^{2}{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}^{4}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]